var t = require("../../cps/component/cpsApi");

Component({
    behaviors: [ t ],
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        },
        page_id: {
            type: null
        },
        btnFlag: {
            type: null
        },
        bottomShowBol: {
            type: null
        },
        index: {
            type: null
        },
        bottomShowBolIndex: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        clientWidth: "375",
        isLast: !1,
        active: 0,
        show_text: "加载中...",
        show_page: !0
    },
    lifetimes: {
        attached: function() {
            this.getCPSLogin();
        },
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {
        this.setData({
            clientWidth: wx.getSystemInfoSync().windowWidth
        }), this.data.bottomShowBolIndex == this.data.index && this.setData({
            isLast: !0
        });
    },
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        getMoreData: function() {
            this.setData({
                page: this.data.page += 1
            }), this.getCPSGood(this.data.active, this.data.datas.list[this.data.active].text, "more");
        },
        onClick: function(t) {
            var e = t.detail.index;
            this.setData({
                active: e,
                page: 1,
                isLoadMore: !0
            }), this.getCPSGood(e, this.data.datas.list[e].text);
        }
    },
    observers: {
        bottomShowBol: function(t) {
            t && this.data.isLast && this.data.isLoadMore && this.getMoreData();
        }
    }
});